package org.qpcr.community.project.service;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * 表头到存储字段的映射规则（支持多个表头别名）。
 */
public class MappingRule {
    private String field;
    private List<String> headers;

    public MappingRule() {
        this.headers = new ArrayList<>();
    }

    public MappingRule(String field, List<String> headers) {
        this.field = field;
        this.headers = new ArrayList<>(headers);
    }

    public static MappingRule of(String field, String... headers) {
        List<String> list = new ArrayList<>();
        if (headers != null) {
            Collections.addAll(list, headers);
        }
        return new MappingRule(field, list);
    }

    public String getField() {
        return field;
    }

    public void setField(String field) {
        this.field = field;
    }

    public List<String> getHeaders() {
        return headers;
    }

    public void setHeaders(List<String> headers) {
        this.headers = headers;
    }
}


